#pragma once

#include "Singleton.h"
#include "tinyxml.h"
#include "BinaryMemory.h"
#include "Texture.h"

class TextureManager;
class SoundManager;

class ResourceManager : public Singleton<ResourceManager>
{
public:
	ResourceManager();
	~ResourceManager();

	BOOL Init( HWND hWnd );
	void UnInit();

public:
	BOOL ReadBinaryXMLToXMLDocument( TiXmlDocument &pDoc, std::string FilePath, TiXmlEncoding EncodingMode = TIXML_DEFAULT_ENCODING );
	BOOL ReadBinaryFileToMemory( BinaryMemory& mem, std::string FilePath );
	FILE* ReadBinaryFileToFilePointer( std::string FilePath );

	//BOOL LoadTextureResource( TiXmlElement* pRoot );
	//BOOL LoadSoundResource( TiXmlElement* pRoot );

public:
	Texture *	CreateTexture( const char* resID, BOOL mipGenerate = TRUE );
	void		ReleaseTexture( const char* resID );

private:
	TextureManager*		m_pTextureManager;
	SoundManager*		m_pSoundManager;
};